import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Card, Col, Form, Input, Row, Select, Upload } from 'antd';
import { connect } from 'umi';
import { PlusOutlined, InboxOutlined } from '@ant-design/icons';
import { vesselTest,vesselrReadTemplate } from '@/network/api/commonApi';
var apiUrl = process.env.apiUrl;

var Form2 = props => {
  // 上传文件提示检查
  const beforeUpload = async file => {
    var formData = new FormData();
    formData.append("file",file);
    vesselrReadTemplate(formData)
    return false;
  };

  return (
    <div>
      {/* <Upload listType="picture-card" beforeUpload={file => beforeUpload(file)}>
        {
          <div>
            <PlusOutlined />
            <div style={{ marginTop: 8 }}>Upload</div>
          </div>
        }
      </Upload> */}

      <form action={`${apiUrl}/vessel/readTemplate`} method="post" enctype="multipart/form-data">
        <input type="text" name="username" />
        <input type="file" name="file" />
        <input type="submit" name="mufile" />
      </form>
    </div>
  );
};

export default connect(({  }) => ({
}))(Form2);
